<template>
	<view style="padding: 10px;">
		<u-grid :col="2" @click="toPage" hover-class="hover-class" :border="false">
			<u-grid-item v-for="(item, index) in list" :index="index" :key="item.id">
				<u-icon :name="item.icon" color="#007AFF" :size="50"></u-icon>
				<text class="grid-text">{{item.name}}</text>
			</u-grid-item>
		</u-grid>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					id: 1,
					icon:'home',
					path:'pages/views/xxcj/zlfw/index',
					name: '租赁房屋'
				}, {
					id: 2,
					icon:'man-add',
					path:'pages/views/xxcj/zfrh/index',
					name: '走访入户登记'
				}, {
					id: 3,
					icon:'server-man',
					path:'pages/views/xxcj/mdjftj/index',
					name: '矛盾纠纷调解'
				}, {
					id: 4,
					icon:'edit-pen',
					path:'pages/views/xxcj/ldrk/index',
					name: '流动人口采集'
				}, {
					id: 5,
					icon:'car',
					path:'pages/views/xxcj/cldj/index',
					name: '车辆登记'
				}/* , {
					id: 99,
					icon:'order',
					path:'pages/views/xxcj/bzcq',
					name: '本周出勤'
				} */],
			};
		},
		methods: {
			toPage(index){
				let item = this.list[index];
				this.$u.route(item.path);
			}
		},
		onLoad() {
			
		},  
		onUnload() {  
			// 移除监听事件  
			uni.$off('addDsr');  
		}
	};
</script>

<style lang="scss" scoped>
	.wrap {
		display: flex;
		flex-direction: column;
		height: calc(100vh - var(--window-top));
		width: 100%;
	}
	.swiper-box {
		flex: 1;
	}
	.swiper-item {
		height: 100%;
	}
	.scroll-view {
		width: 100%;
		height: 100%;
	}
</style>
